#include <iostream>
#include <cstdio>
using namespace std;

int main(){
	int x;
	cin>>x;
	x=x*1000+x;
	cout<<x/7/11/13; 
	return 0;
}
